package com.kucai.yifaqapp.ui.activity;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.bigkoo.pickerview.OptionsPickerView;
import com.kucai.yifaqapp.R;
import com.kucai.yifaqapp.dagger.component.activity.DaggerLuzhuActivityComponent;
import com.kucai.yifaqapp.dagger.module.activity.LuzhuActivityModule;
import com.kucai.yifaqapp.global.HttpAdress;
import com.kucai.yifaqapp.model.network.entity.res.ResLuzhu;
import com.kucai.yifaqapp.presenter.activity.LuzhuActivityPesenter;
import com.kucai.yifaqapp.ui.view.LuzhuView;
import com.kucai.yifaqapp.util.OnItemClickListener;

import java.util.ArrayList;
import java.util.List;

import butterknife.OnClick;

import static com.kucai.yifaqapp.global.App.getContext;

public class LuzhuActivity extends BaseActivity<LuzhuActivityPesenter> implements LuzhuView {
    TextView titleLeftTv;
    TextView headerTitle;
    TextView gameBt;
    TextView refreshBt;
    TextView tabbt1;
    TextView tabbt2;
    TextView tabbt3;
    RecyclerView longsidesRl;
    TextView tabbt4;
    TextView tabbt5;
    TextView tabbt6;
    TextView tabbt7;
    TextView tabbt8;
    LinearLayout downlayout;
    RecyclerView luzhu2Rl;
    RecyclerView luzhu3Rl;
    LinearLayout skinbg;
    private String gameid;
    private Adapter adapter;
    private Adapter2 adapter2;
    private Adapter3 adapter3;
    private List<ResLuzhu.LineDown2Bean> luzhulist = new ArrayList<>();
    private List<String> luzhuitem = new ArrayList<>();//第一个列表
    private List<String> luzhuitem2 = new ArrayList<>();//第2个列表
    private List<String> luzhuitem3 = new ArrayList<>();//第3个列表
    private OptionsPickerView gamebtStrig;//底部选择器
    private static final List<String> options1Items = new ArrayList<>();//游戏弹框

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        titleLeftTv = findViewById(R.id.title_left_tv);
        headerTitle = findViewById(R.id.headerTitle);
        gameBt = findViewById(R.id.game_bt);
        refreshBt = findViewById(R.id.refresh_bt);
        tabbt1 = findViewById(R.id.tabbt1);
        tabbt2 = findViewById(R.id.tabbt2);
        tabbt3 = findViewById(R.id.tabbt3);
        tabbt4 = findViewById(R.id.tabbt4);
        tabbt5 = findViewById(R.id.tabbt5);
        tabbt6 = findViewById(R.id.tabbt6);
        tabbt7 = findViewById(R.id.tabbt7);
        tabbt8 = findViewById(R.id.tabbt8);
        downlayout = findViewById(R.id.downlayout);
        longsidesRl = findViewById(R.id.longsides_rl);
        luzhu2Rl = findViewById(R.id.luzhu2_rl);
        luzhu3Rl = findViewById(R.id.luzhu3_rl);
        skinbg = findViewById(R.id.skinbg);


        Intent intent = getIntent();
        gameid = intent.getStringExtra("gameid");
        gameBt.setText(intent.getStringExtra("gamename"));
        if (gameid != null) {
            String a = HttpAdress.getuseAdress() + "mobile/static/data/";
            String b = gameid + "stat_game_mobile.json";
            mPresenter.getluzhu(a + b);
            swithctext();
        }

        titleLeftTv.setText("返回");
        titleLeftTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        headerTitle.setText("路珠");
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
        linearLayoutManager.setOrientation(linearLayoutManager.HORIZONTAL);
        longsidesRl.setLayoutManager(linearLayoutManager);
        //创建适配器
        adapter = new Adapter();
        longsidesRl.setAdapter(adapter);
        //
        LinearLayoutManager linearLayoutManager1 = new LinearLayoutManager(this);
        linearLayoutManager1.setOrientation(linearLayoutManager1.HORIZONTAL);
        luzhu2Rl.setLayoutManager(linearLayoutManager1);
        adapter2 = new Adapter2();
        luzhu2Rl.setAdapter(adapter2);
        //
        LinearLayoutManager linearLayoutManager2 = new LinearLayoutManager(this);
        linearLayoutManager2.setOrientation(linearLayoutManager2.HORIZONTAL);
        luzhu3Rl.setLayoutManager(linearLayoutManager2);
        adapter3 = new Adapter3();
        luzhu3Rl.setAdapter(adapter3);

        gamebtStrig = new OptionsPickerView.Builder(LuzhuActivity.this, new OptionsPickerView.OnOptionsSelectListener() {
            @Override
            public void onOptionsSelect(int options1, int option2, int options3, View v) {
                //返回的分别是三个级别的选中位置
                switch (options1) {
                    case 0:
                        gameBt.setText("秒速赛车");
                        gameid = "80";
                        if (gameid != null) {
                            String a = HttpAdress.getuseAdress() + "mobile/static/data/";
                            String b = gameid + "stat_game_mobile.json";
                            mPresenter.getluzhu(a + b);
                            swithctext();
                        }
                        break;
                    case 1:
                        gameBt.setText("北京赛车");
                        gameid = "50";
                        if (gameid != null) {
                            String a = HttpAdress.getuseAdress() + "mobile/static/data/";
                            String b = gameid + "stat_game_mobile.json";
                            mPresenter.getluzhu(a + b);
                            swithctext();
                        }
                        break;
                    case 2:
                        gameBt.setText("秒速飞艇");
                        gameid = "82";
                        if (gameid != null) {
                            String a = HttpAdress.getuseAdress() + "mobile/static/data/";
                            String b = gameid + "stat_game_mobile.json";
                            mPresenter.getluzhu(a + b);
                            swithctext();
                        }
                        break;
                    case 3:
                        gameBt.setText("香港跑马");
                        gameid = "99";
                        if (gameid != null) {
                            String a = HttpAdress.getuseAdress() + "mobile/static/data/";
                            String b = gameid + "stat_game_mobile.json";
                            mPresenter.getluzhu(a + b);
                            swithctext();
                        }
                        break;
                    case 5:
                        gameBt.setText("北京快乐8");
                        gameid = "65";
                        if (gameid != null) {
                            String a = HttpAdress.getuseAdress() + "mobile/static/data/";
                            String b = gameid + "stat_game_mobile.json";
                            mPresenter.getluzhu(a + b);
                            swithctext();
                        }
                        break;
                    case 6:
                        gameBt.setText("秒速时时彩");
                        gameid = "81";
                        if (gameid != null) {
                            String a = HttpAdress.getuseAdress() + "mobile/static/data/";
                            String b = gameid + "stat_game_mobile.json";
                            mPresenter.getluzhu(a + b);
                            swithctext();
                        }
                        break;
                    case 7:
                        gameBt.setText("重庆时时彩");
                        gameid = "1";
                        if (gameid != null) {
                            String a = HttpAdress.getuseAdress() + "mobile/static/data/";
                            String b = gameid + "stat_game_mobile.json";
                            mPresenter.getluzhu(a + b);
                            swithctext();
                        }
                        break;
                    case 9:
                        gameBt.setText("广东快乐十分");
                        gameid = "60";
                        if (gameid != null) {
                            String a = HttpAdress.getuseAdress() + "mobile/static/data/";
                            String b = gameid + "stat_game_mobile.json";
                            mPresenter.getluzhu(a + b);
                            swithctext();
                        }
                        break;
                    case 10:
                        gameBt.setText("重庆幸运农场");
                        gameid = "61";
                        if (gameid != null) {
                            String a = HttpAdress.getuseAdress() + "mobile/static/data/";
                            String b = gameid + "stat_game_mobile.json";
                            mPresenter.getluzhu(a + b);
                            swithctext();
                        }
                        break;
                    case 11:
                        gameBt.setText("重庆幸运农场");
                        gameid = "21";
                        if (gameid != null) {
                            String a = HttpAdress.getuseAdress() + "mobile/static/data/";
                            String b = gameid + "stat_game_mobile.json";
                            mPresenter.getluzhu(a + b);
                            swithctext();
                        }
                        break;
                    case 12:
                        gameBt.setText("QQ分分彩");
                        gameid = "113";
                        if (gameid != null) {
                            String a = HttpAdress.getuseAdress() + "mobile/static/data/";
                            String b = gameid + "stat_game_mobile.json";
                            mPresenter.getluzhu(a + b);
                            swithctext();
                        }
                        break;
                }

            }
        })
                .setSubCalSize(20)//确定和取消文字大小
                .setSubmitColor(Color.BLUE)//确定按钮文字颜色
                .setCancelColor(Color.BLUE)//取消按钮文字颜色
                .setTextColorCenter(Color.BLACK)//设置选中项的颜色
                .build();
        options1Items.clear();
        options1Items.add("秒速赛车");
        options1Items.add("北京赛车");
        options1Items.add("秒速飞艇");
        options1Items.add("香港跑马");
        options1Items.add("pc蛋蛋");
        options1Items.add("北京快乐8");
        options1Items.add("秒速时时彩");
        options1Items.add("重庆时时彩");
        options1Items.add("新疆时时彩");
        options1Items.add("广东快乐十分");
        options1Items.add("重庆幸运农场");
        options1Items.add("广东十一选五");
        options1Items.add("QQ分分彩");
        gamebtStrig.setPicker(options1Items);

    }

    private void swithctext() {
        if (gameid.equals("80") || gameid.equals("50") || gameid.equals("82") || gameid.equals("99")) {
            downlayout.setVisibility(View.GONE);
            tabbt1.setText("冠亚和");
            tabbt2.setText("冠亚和大小");
            tabbt3.setText("冠亚和单双");
            tabbt1.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("GYH".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt1.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
                }


            });
            tabbt2.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("GYHDX".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt2.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt1.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
                }
            });
            tabbt3.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("GYHDS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt3.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt1.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
                }
            });
        } else if (gameid.equals("1") || gameid.equals("81")) {
            downlayout.setVisibility(View.VISIBLE);
            tabbt1.setText("总和大小");
            tabbt2.setText("总和单双");
            tabbt3.setText("龙虎");
            tabbt1.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("ZHDX".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));

                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt1.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
                }


            });
            tabbt2.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("ZHDS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt2.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt1.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
                }
            });
            tabbt3.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("ZHLHH".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt3.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt1.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
                }
            });
            //时时彩下半部分
            tabbt4.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
            tabbt4.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt4.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU1".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("QIU1DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt5.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt5.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU2".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("QIU2DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt6.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt6.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU3".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("QIU3DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt7.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt7.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU4".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("QIU4DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt8.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt8.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU5".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("QIU5DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });


        }
        if (gameid.equals("65")) {
            downlayout.setVisibility(View.GONE);
            tabbt1.setText("总和数");
            tabbt2.setText("总和大小");
            tabbt3.setText("总和单双");
            tabbt1.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("bjkl8ZH".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt1.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
                }


            });
            tabbt2.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("bjkl8ZHDX".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt2.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt1.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
                }
            });
            tabbt3.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("bjkl8ZHDS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt3.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt1.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
                }
            });
        }
        if (gameid.equals("60")) {
            downlayout.setVisibility(View.VISIBLE);
            tabbt1.setText("总和大小");
            tabbt2.setText("总和单双");
            tabbt3.setText("总和尾大小");
            tabbt1.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("NCZHDX".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt1.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
                }


            });
            tabbt2.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("NCZHDS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt2.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt1.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
                }
            });
            tabbt3.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("NCZHWSDX".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt3.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt1.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
                }
            });

            tabbt4.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
            tabbt4.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt4.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU1".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("NCQIU1DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt5.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt5.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU2".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("NCQIU2DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt6.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt6.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU3".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("NCQIU3DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt7.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt7.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU4".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("NCQIU4DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt8.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt8.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU5".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("NCQIU5DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });


        }
        if (gameid.equals("61")) {
            tabbt1.setText("冠亚和");
            tabbt2.setText("冠亚和大小");
            tabbt3.setText("冠亚和单双");
            tabbt1.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("NCZHDX".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt1.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
                }


            });
            tabbt2.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("NCZHDS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt2.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt1.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
                }
            });
            tabbt3.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("NCZHWSDX".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt3.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt1.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
                }
            });
            tabbt4.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
            tabbt4.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt4.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU1".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("NCQIU1DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt5.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt5.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU2".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("NCQIU2DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt6.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt6.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU3".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("NCQIU3DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt7.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt7.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU4".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("NCQIU4DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt8.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt8.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU5".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("NCQIU5DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });


        }
        if (gameid.equals("21")) {

            tabbt1.setText("总和大小");
            tabbt2.setText("总和单双");
            tabbt3.setText("龙虎");
            tabbt1.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("ZHDX".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt1.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
                }


            });
            tabbt2.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("ZHDS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt2.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt1.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
                }
            });
            tabbt3.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("ZHLHH".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt3.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt1.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
                }
            });
            tabbt4.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
            tabbt4.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt4.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU1".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("QIU1DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt5.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt5.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU2".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("QIU2DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt6.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt6.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU3".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("QIU3DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt7.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt7.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU4".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("QIU4DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });
            tabbt8.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    downbtsetcolor();
                    tabbt8.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("QIU5".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                        if ("QIU5DS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }
                        }
                    }
                    adapter2.notifyDataSetChanged();
                    adapter3.notifyDataSetChanged();
                }
            });

        }
        if (gameid.equals("62")) {
            tabbt1.setText("总和大小");
            tabbt2.setText("总和单双");
            tabbt3.setText("龙虎");
            tabbt1.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("NCZHDX".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt1.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
                }


            });
            tabbt2.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("NCZHDS".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt2.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt1.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
                }
            });
            tabbt3.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    luzhuitem.clear();
                    for (int a = 0; a < luzhulist.size(); a++) {
                        if ("NCZHWSDX".equals(luzhulist.get(a).name)) {
                            for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                                luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                            }

                        }
                    }
                    adapter.notifyDataSetChanged();
                    tabbt3.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
                    tabbt1.setBackgroundResource(R.drawable.betting_backgroud);
                    tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
                }
            });
        }
    }

    private void downbtsetcolor() {
        tabbt4.setBackgroundResource(R.drawable.betting_backgroud);
        tabbt5.setBackgroundResource(R.drawable.betting_backgroud);
        tabbt6.setBackgroundResource(R.drawable.betting_backgroud);
        tabbt7.setBackgroundResource(R.drawable.betting_backgroud);
        tabbt8.setBackgroundResource(R.drawable.betting_backgroud);
        luzhuitem2.clear();
        luzhuitem3.clear();
    }

    @Override
    protected int setContentView() {
        return R.layout.activity_luzhu;
    }

    @Override
    protected void ChangeSkin() {
        switch (SkinId) {
            case 17771:
                skinbg.setBackgroundResource(R.mipmap.skin_bg1);
                break;
            case 17772:
                skinbg.setBackgroundResource(R.mipmap.skin_bg2);
                break;
            case 17773:
                skinbg.setBackgroundResource(R.mipmap.skin_bg3);
                break;
            default:
                skinbg.setBackgroundResource(R.mipmap.skin_bg1);
        }
    }

    @Override
    protected void initDagger() {
        DaggerLuzhuActivityComponent.builder()
                .luzhuActivityModule(new LuzhuActivityModule(this))
                .build().inject(this);
    }

    @Override
    public void getluzhu(ResLuzhu resLuzhu) {
        downbtsetcolor();
        luzhulist.clear();
        tabbt4.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
        luzhulist.addAll(resLuzhu.line_down2);
        if (gameid.equals("80") || gameid.equals("50") || gameid.equals("82") || gameid.equals("99")) {
            tabbt1.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
            tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
            tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
            luzhuitem.clear();
            for (int a = 0; a < luzhulist.size(); a++) {
                if ("GYH".equals(luzhulist.get(a).name)) {
                    for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                        luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                    }
                }
            }
        } else if (gameid.equals("1") || gameid.equals("81")|| gameid.equals("113")) {
            //时时彩
            tabbt1.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
            tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
            tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
            luzhuitem.clear();
            for (int a = 0; a < luzhulist.size(); a++) {
                if ("ZHDX".equals(luzhulist.get(a).name)) {
                    for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                        luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                    }
                }
                if ("QIU1".equals(luzhulist.get(a).name)) {
                    for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                        luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                    }
                }
                if ("QIU1DS".equals(luzhulist.get(a).name)) {
                    for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                        luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                    }
                }
            }

        } else if (gameid.equals("65")) {
            tabbt1.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
            tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
            tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
            luzhuitem.clear();
            for (int a = 0; a < luzhulist.size(); a++) {
                if ("ZHS".equals(luzhulist.get(a).name)) {
                    for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                        luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                    }
                }
            }
        } else if (gameid.equals("60")) {
            //快乐十分
            tabbt1.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
            tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
            tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
            luzhuitem.clear();
            for (int a = 0; a < luzhulist.size(); a++) {
                if ("NCZHDX".equals(luzhulist.get(a).name)) {
                    for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                        luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                    }
                }
                if ("QIU1".equals(luzhulist.get(a).name)) {
                    for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                        luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                    }
                }
                if ("NCQIU1DS".equals(luzhulist.get(a).name)) {
                    for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                        luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                    }
                }
            }
        } else if (gameid.equals("61")) {
            //幸运农场
            downlayout.setVisibility(View.VISIBLE);
            tabbt1.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
            tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
            tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
            luzhuitem.clear();
            for (int a = 0; a < luzhulist.size(); a++) {
                if ("NCZHDX".equals(luzhulist.get(a).name)) {
                    for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                        luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                    }
                }
                if ("QIU1".equals(luzhulist.get(a).name)) {
                    for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                        luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                    }
                }
                if ("NCQIU1DS".equals(luzhulist.get(a).name)) {
                    for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                        luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                    }
                }
            }
        } else if (gameid.equals("21")) {
            downlayout.setVisibility(View.VISIBLE);
            tabbt1.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
            tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
            tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
            luzhuitem.clear();
            for (int a = 0; a < luzhulist.size(); a++) {
                if ("ZHDX".equals(luzhulist.get(a).name)) {
                    for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                        luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                    }
                }
                if ("QIU1".equals(luzhulist.get(a).name)) {
                    for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                        luzhuitem2.add(String.valueOf(luzhulist.get(a).data.get(i)));
                    }
                }
                if ("QIU1DS".equals(luzhulist.get(a).name)) {
                    for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                        luzhuitem3.add(String.valueOf(luzhulist.get(a).data.get(i)));
                    }
                }
            }
        } else if (gameid.equals("65")) {
            tabbt1.setBackgroundColor(getContext().getResources().getColor(R.color.gamebackground));
            tabbt2.setBackgroundResource(R.drawable.betting_backgroud);
            tabbt3.setBackgroundResource(R.drawable.betting_backgroud);
            luzhuitem.clear();
            for (int a = 0; a < luzhulist.size(); a++) {
                if ("ZHS".equals(luzhulist.get(a).name)) {
                    for (int i = 0; i < luzhulist.get(a).data.size(); i++) {
                        luzhuitem.add(String.valueOf(luzhulist.get(a).data.get(i)));
                    }
                }
            }
        }
        adapter.notifyDataSetChanged();
        adapter2.notifyDataSetChanged();
        adapter3.notifyDataSetChanged();
    }

    @OnClick({R.id.game_bt, R.id.refresh_bt})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.game_bt:
                gamebtStrig.show();
                break;
            case R.id.refresh_bt:
                if (gameid != null) {
                    String a = HttpAdress.getuseAdress() + "mobile/static/data/";
                    String b = gameid + "stat_game_mobile.json";
                    mPresenter.getluzhu(a + b);
                    swithctext();
                }
                break;
        }
    }

    ///////////////////////////////////////第一部分、、、、、、、、////////////////////////////////////////
    class Adapter extends RecyclerView.Adapter<Adapter.MViewHolder>
            implements OnItemClickListener {
        @Override
        public MViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            return new MViewHolder(LayoutInflater.from(getContext())
                    .inflate(R.layout.luzhuitem, parent, false));

        }

        @Override
        public void onBindViewHolder(final MViewHolder holder, final int position) {
            String name = luzhuitem.get(position);
            String str = name.substring(1, name.length() - 1);
            holder.luzhutext.setText(str);
        }

        ///////////////////切记更改
        @Override
        public int getItemCount() {
            return luzhuitem.size();
        }

        @Override
        public void onItemClick(View view, int position) {

        }

        class MViewHolder extends RecyclerView.ViewHolder {
            TextView luzhutext;

            MViewHolder(View itemView) {
                super(itemView);
                luzhutext = (TextView) itemView.findViewById(R.id.luzhutext);
            }
        }
    } ///////////////////////////////////////第2部分、、、、、、、、////////////////////////////////////////

    class Adapter2 extends RecyclerView.Adapter<Adapter2.MViewHolder>
            implements OnItemClickListener {
        @Override
        public MViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            return new MViewHolder(LayoutInflater.from(getContext())
                    .inflate(R.layout.luzhuitem, parent, false));

        }

        @Override
        public void onBindViewHolder(final MViewHolder holder, final int position) {
            String name = luzhuitem2.get(position);
            String str = name.substring(1, name.length() - 1);
            holder.luzhutext.setText(str);
        }

        @Override
        public int getItemCount() {
            return luzhuitem2.size();

        }

        @Override
        public void onItemClick(View view, int position) {

        }

        class MViewHolder extends RecyclerView.ViewHolder {
            TextView luzhutext;

            MViewHolder(View itemView) {
                super(itemView);
                luzhutext = (TextView) itemView.findViewById(R.id.luzhutext);
            }
        }
    } ///////////////////////////////////////第3部分、、、、、、、、////////////////////////////////////////

    class Adapter3 extends RecyclerView.Adapter<Adapter3.MViewHolder>
            implements OnItemClickListener {
        @Override
        public MViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            return new MViewHolder(LayoutInflater.from(getContext())
                    .inflate(R.layout.luzhuitem, parent, false));

        }

        @Override
        public void onBindViewHolder(final MViewHolder holder, final int position) {
            String name = luzhuitem3.get(position);
            String str = name.substring(1, name.length() - 1);
            holder.luzhutext.setText(str);


        }

        @Override
        public int getItemCount() {
            return luzhuitem3.size();

        }

        @Override
        public void onItemClick(View view, int position) {

        }

        class MViewHolder extends RecyclerView.ViewHolder {
            TextView luzhutext;

            MViewHolder(View itemView) {
                super(itemView);
                luzhutext = (TextView) itemView.findViewById(R.id.luzhutext);
            }
        }
    }
}
